<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="BookBorrowingEditDlg" widgetVar="BookBorrowingEditDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.EditBookBorrowingTitle}">

            <h:form id="BookBorrowingEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{bookBorrowingController.selected != null}">

                        <h:outputLabel value="#{bundle.EditBookBorrowingLabel_idbookBorrowing}" for="idbookBorrowing" />
                        <h:outputText id="idbookBorrowing" value="#{bookBorrowingController.selected.idbookBorrowing}" />

                        <p:outputLabel value="#{bundle.EditBookBorrowingLabel_date}" for="date" />
                        <p:calendar id="date" pattern="MM/dd/yyyy HH:mm:ss" value="#{bookBorrowingController.selected.date}" title="#{bundle.EditBookBorrowingTitle_date}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.EditBookBorrowingLabel_employeeidEmployee}" for="employeeidEmployee" />
                        <p:selectOneMenu id="employeeidEmployee" value="#{bookBorrowingController.selected.employeeidEmployee}" required="true" requiredMessage="#{bundle.EditBookBorrowingRequiredMessage_employeeidEmployee}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{employeeController.items}"
                                           var="employeeidEmployeeItem"
                                           itemValue="#{employeeidEmployeeItem}"
                                           itemLabel="#{employeeidEmployeeItem.idEmployee.toString()}"
                                           />
                            <f:converter binding="#{employeeConverter}"/>
                        </p:selectOneMenu>

                        <p:outputLabel value="#{bundle.EditBookBorrowingLabel_studentidStudent}" for="studentidStudent" />
                        <p:selectOneMenu id="studentidStudent" value="#{bookBorrowingController.selected.studentidStudent}" required="true" requiredMessage="#{bundle.EditBookBorrowingRequiredMessage_studentidStudent}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{studentController.items}"
                                           var="studentidStudentItem"
                                           itemValue="#{studentidStudentItem}"
                                           itemLabel="#{studentidStudentItem.idStudent.toString()}"
                                           />
                            <f:converter binding="#{studentConverter}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{bookBorrowingController.save}" value="#{bundle.Save}" update="display,:BookBorrowingListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,BookBorrowingEditDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="BookBorrowingEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
